/************************************************************************
                                                                     
   Xceed Ultimate ListBox for Silverlight                                                                                                                                            
   Copyright (C) 2010 Xceed Software Inc.    
                                                                     
   This program is provided to you under the terms of the GNU General Public  
   License version 2 as published by the Free Software Foundation. 
        
   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY, without even the implied warranty of 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License along 
   with this program, if not, write to the Free Software Foundation, Inc., 
   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

   This program can be provided to you by Xceed Software Inc. under a
   proprietary commercial license agreement for use in non-Open Source
   projects. Visit Xceed.com to find the commercial edition of 
   Xceed Ultimate ListBox for Silverlight.                                    
                                                                      
 **********************************************************************/

using System.Windows;

// This source code obtained from CodeProject and 
// the URL is http://www.codeproject.com/KB/silverlight/TextOnAPathSilverlight.aspx?msg=2872095.
namespace Xceed.Silverlight.Utils
{
  internal class PointHelper
  {
    public PointHelper()
    {
    }

    public Point Value
    {
      get
      {
        return m_value;
      }
      set
      {
        m_value = value;
      }
    }

    public PointHelper( Point input )
    {
      m_value = input;
    }

    public static Vector operator -( PointHelper point1, PointHelper point2 )
    {
      return new Vector( point1.m_value.X - point2.m_value.X, point1.m_value.Y - point2.m_value.Y );
    }

    //
    // Summary:
    //     Translates the specified System.Windows.Point by the specified System.Windows.Vector
    //     and returns the result.
    //
    // Parameters:
    //   point:
    //     The point to translate.
    //
    //   vector:
    //     The amount by which to translate point.
    //
    // Returns:
    //     The result of translating the specified point by the specified vector.
    public static PointHelper operator +( PointHelper point, Vector vector )
    {
      PointHelper result = new PointHelper();

      result.m_value.X = vector.X + point.Value.X;
      result.m_value.Y = vector.Y + point.Value.Y;

      return result;
    }

    Point m_value;
  }
}
